import { createSlice } from "@reduxjs/toolkit";

const calculateSlice = createSlice({
  name: "calculate",
  initialState: {
    calculate: 0,
  },
  reducers: {
    addAction(state,action) {
      state.calculate += action.payload
    },
    subAction(state,action) {
      state.calculate -= action.payload
    },
  },
});

const {addAction, subAction} = calculateSlice.actions;

const calculateReducer = calculateSlice.reducer;

export {addAction, subAction}

export default calculateReducer;